package com.util;


import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import javax.servlet.ServletContext;

import org.apache.struts2.ServletActionContext;

import com.enetiy.Area;
import com.enetiy.Comboinfo;
import com.enetiy.Comborecord;
import com.service.AreaService;
import com.service.ComboService;

public class Verify {
	/**
	 * 
	 * 区域验证
	 * @param areaid
	 * @param areaService
	 * @return
	 * @throws Exception
	 */
	public static Area getArea(int areaid, AreaService areaService) throws Exception{
		//查询数据库
		Area area = areaService.selectArea(areaid);
		return area;
	}
	/**
	 * 套餐过期验证
	 * @return
	 * @throws Exception 
	 */
	
	public static Comboinfo pastCombo(Comboinfo comboinfo,ComboService comboService) throws Exception{
		Long m = new Date().getTime();
		Long t = comboinfo.getEndTime().getTime();
		if((m-t)>0){
			comboinfo.setStatus(0);
			comboService.updateUserCombo(comboinfo);
		}
		return comboinfo;
	}
}
